#!/usr/bin/env python
# This script will print the list of test classes in
# scripts_regression_tests.py
#
import unittest
DEBUG = False

#pylint: disable=protected-access
def list_tests_from():
    loader = unittest.TestLoader()
    suite = loader.discover(".", pattern="scripts_regression_tests.py")
    test_classes = []
    for alltests in suite:
        tests = alltests._tests
        if len(tests):
            for atest in tests:
                if DEBUG:
                    print(atest)
                for btest in atest._tests:
                    btestname = btest.__str__().split()
                    test_classes.append(btestname[1][1:-1].split('.')[1])
    # add this explicitly, not captured by the above
    test_classes.append("B_CheckCode")
    for ctest in sorted(list(set(test_classes))):
        print(ctest)


if __name__ == "__main__":
    # Include the directories
    list_tests_from()
